package org.misty.practices.map.hashmap;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

public class ConcurrentHashMapSample01 {
    public static void main(String[] args) throws InterruptedException {
        var cmap = new ConcurrentHashMap<>();
        for (var i = 0; i <= 10000; i++) {
            cmap.put(i, i);
        }
        System.out.println(cmap);
        for (var i = 0; i <= 10000; i++) {
            cmap.remove(i);
        }
        System.gc();
        TimeUnit.SECONDS.sleep(1);
        System.out.println(cmap);
        cmap.get(1);
    }
}
